package load;

/**
 * @since 理解java类加载机制
 * 1)加载
 * 2)连接（验证-准备-解析）
 * 3)初始化
 */
public class Singleton {
    private static Singleton singleton = new Singleton();
    private Count count = new Count();
    public static int counter1;
    public static int counter2 = 0;
    public int counter3 = 1;
    private Singleton() {
        counter1++;
        counter2++;
        counter3++;
    }
    static {
        System.out.println("静态方法加载");
    }
    public static Singleton getSingleton() {
        return singleton;
    }
}

